package com.diankangwo.factory.service.impl;

import com.diankangwo.factory.dao.TdCategoryMapper;
import com.diankangwo.factory.entity.TdCategory;
import com.diankangwo.factory.service.TdCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service("TdCategoryService")
public class TdCategoryServiceImpl implements TdCategoryService {

    @Autowired
    private TdCategoryMapper mapper;

    @Override
    @Transactional
    public int deleteByPrimaryKey(Integer id) {
        return mapper.deleteByPrimaryKey(id);
    }

    @Override
    @Transactional
    public int insert(TdCategory record) {
        return mapper.insert(record);
    }

    @Override
    @Transactional
    public int insertSelective(TdCategory record) {
        return mapper.insertSelective(record);
    }

    @Override
    public TdCategory selectByPrimaryKey(Integer id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<TdCategory> selectByCommodityId(Integer id) {
        return mapper.selectByCommodityId(id);
    }

    @Override
    @Transactional
    public int updateByPrimaryKeySelective(TdCategory record) {
        return mapper.updateByPrimaryKeySelective(record);
    }

    @Override
    @Transactional
    public int updateByPrimaryKey(TdCategory record) {
        return mapper.updateByPrimaryKey(record);
    }
}
